package com.googlecode.gingerman.world;

import ui.Scene;

import com.googlecode.gingerman.robot.AIChassis;
import com.googlecode.gingerman.robot.AILocator;
import com.googlecode.gingerman.robot.AIRobot;
import com.googlecode.gingerman.robot.AIWeapon;
import com.googlecode.gingerman.robot.Chassis;
import com.googlecode.gingerman.robot.Health;
import com.googlecode.gingerman.robot.Locator;
import com.googlecode.gingerman.robot.Robot;
import com.googlecode.gingerman.robot.SimpleAI;
import com.googlecode.gingerman.robot.Weapon;

public class Map1 {
	double x=80,y=500;
	
	public Map1(Scene poligon, World world, double radius, double wallWidth, double wallHeigth){
		for (int i = 1; i < 21; i++) {
			
			Wall wall=new Wall(500, 30*i, wallWidth, wallHeigth, 0);
			
			world.addWall(wall);
			poligon.addObject(wall);
			poligon.repaint();
		
		}
		
		for (int i = 0, idCmd = 0; i < 3; i++, y += 80) {
			
			Robot robot = new Robot(5, idCmd, world);
			Locator locator = new Locator(robot);
			Chassis chassis = new Chassis(x, y, 0, radius, robot);
			Weapon weapon = new Weapon(robot);
			SimpleAI AI = new SimpleAI((AIRobot)robot, (AIChassis)chassis, (AILocator)locator, (AIWeapon)weapon);
			Health health=new Health(robot);
			
			robot.setChassis(chassis);
			robot.setLocator(locator);
			robot.setWeapon(weapon);
			robot.setSimpleAI(AI);
			robot.setGhealth(health);
			
			world.addRobot(robot);
			poligon.addObject(health);
			poligon.addObject(robot);
			poligon.repaint();
		
		}
		
		x = 940; y = 500;
		
		for (int i = 0, idCmd = 1; i < 3; i ++, y += 80) {
			
			Robot robot = new Robot(5, idCmd, world);
			Locator locator = new Locator(robot);
			Chassis chassis = new Chassis(x, y, Math.PI, radius, robot);
			Weapon weapon = new Weapon(robot);
			SimpleAI AI = new SimpleAI((AIRobot)robot, (AIChassis)chassis, (AILocator)locator, (AIWeapon)weapon);
			Health health=new Health(robot);
			
			robot.setChassis(chassis);
			robot.setLocator(locator);
			robot.setWeapon(weapon);
			robot.setSimpleAI(AI);
			robot.setGhealth(health);
			
			world.addRobot(robot);
			poligon.addObject(health);
			poligon.addObject(robot);
			poligon.repaint();
			
		}
	}
	
}
